/*
2021-7-19
https://leetcode-cn.com/problems/add-minimum-number-of-rungs/ 
*/

class Solution {
public:
    int addRungs(vector<int>& rungs, int dist) {
        int len=rungs.size();
        int cnt=0;
        for(int i=0;i<len-1;i++)
        {
            cnt+=(rungs[i+1]-rungs[i]-1)/dist;
        }
        cnt+=(rungs[0]-0-1)/dist;
        return cnt;
    }
};

